<?php

namespace app\adminmini\service;


use app\adminmini\model\Method;

class MethodService extends BaseService
{
    public function __construct()
    {
        $this->model = new Method();
    }

    public function edit()
    {
        $data = request()->param();


        $data['store_id'] = $this->userId();


        $result = $this->model->edit($data, $error);
        return message('操作成功', true);
    }

    public function getList()
    {
        $param = request()->param();

        // 查询条件
        $map = [];


        // 名称
        $name = isset($param['name']) ? trim($param['name']) : '';
        if ($name) {
            $map[] = ['name', 'like', "%{$name}%"];
        }
        $map[] = ['mark', '=', 1];
        $map[] = ['store_id', '=', $this->userId()];
        return parent::getList($map); // TODO: Change the autogenerated stub
    }
}